Page({
  data: {
    sympthomName:'',
    info:{},
    showName:true,
    showDesc:false,
    showMedical:false,
    showDep:false
  },
  onLoad: function (options) {
    this.setData({
      sympthomName:options.name
    })
    this.getApiFn()
  },

  // 接口调用函数
  getApiFn(){
    wx.cloud.callFunction({
      name:'getSympthomInfo',
      data:{sympthomname:this.data.sympthomName}
    }).then(res =>{
      this.setData({
        info:res.result.data
      })
    }).catch(err => console.log(err))
  },

  // 点击名称
  handleName(){
    this.setData({
      showName:!this.data.showName
    })
  },
  // 点击详情
  handleDesc(){
    this.setData({
      showDesc:!this.data.showDesc
    })
  },
  //点击推荐用药
  handleMedical(){
    this.setData({
      showMedical:!this.data.showMedical
    })
  },
  //点击建议挂号科室
  handleDep(){
    this.setData({
      showDep:!this.data.showDep
    })
  }
})